package com.example.entity;

import javax.persistence.*;
import java.sql.Time;
import java.util.Objects;

@Entity
@Table(name = "EMPLOYEE", schema = "TEST", catalog = "")
public class EmployeeEntity {
    private String employeeId;
    private String name;
    private Time birthday;
    private String address;
    private String habit;
    private String selfDesc;
    private Long sal;

    @Id
    @Column(name = "EMPLOYEE_ID", nullable = false, length = 32)
    public String getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(String employeeId) {
        this.employeeId = employeeId;
    }

    @Basic
    @Column(name = "NAME", nullable = true, length = 20)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "BIRTHDAY", nullable = true)
    public Time getBirthday() {
        return birthday;
    }

    public void setBirthday(Time birthday) {
        this.birthday = birthday;
    }

    @Basic
    @Column(name = "ADDRESS", nullable = true, length = 200)
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Basic
    @Column(name = "HABIT", nullable = true, length = 200)
    public String getHabit() {
        return habit;
    }

    public void setHabit(String habit) {
        this.habit = habit;
    }

    @Basic
    @Column(name = "SELF_DESC", nullable = true, length = 200)
    public String getSelfDesc() {
        return selfDesc;
    }

    public void setSelfDesc(String selfDesc) {
        this.selfDesc = selfDesc;
    }

    @Basic
    @Column(name = "SAL", nullable = true, precision = 0)
    public Long getSal() {
        return sal;
    }

    public void setSal(Long sal) {
        this.sal = sal;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        EmployeeEntity that = (EmployeeEntity) o;
        return Objects.equals(employeeId, that.employeeId) &&
                Objects.equals(name, that.name) &&
                Objects.equals(birthday, that.birthday) &&
                Objects.equals(address, that.address) &&
                Objects.equals(habit, that.habit) &&
                Objects.equals(selfDesc, that.selfDesc) &&
                Objects.equals(sal, that.sal);
    }

    @Override
    public int hashCode() {
        return Objects.hash(employeeId, name, birthday, address, habit, selfDesc, sal);
    }
}
